home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / AbstractDocument$ElementEdit.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.4 KB  |  54 lines

  1. package javax.swing.text;
  2.  
  3. import javax.swing.event.DocumentEvent;
  4. import javax.swing.undo.AbstractUndoableEdit;
  5. import javax.swing.undo.CannotRedoException;
  6. import javax.swing.undo.CannotUndoException;
  7.  
  8. public class AbstractDocument$ElementEdit extends AbstractUndoableEdit implements DocumentEvent.ElementChange {
  9.    // $FF: renamed from: e javax.swing.text.Element
  10.    private Element field_0;
  11.    private int index;
  12.    private Element[] removed;
  13.    private Element[] added;
  14.  
  15.    public AbstractDocument$ElementEdit(Element var1, int var2, Element[] var3, Element[] var4) {
  16.       this.field_0 = var1;
  17.       this.index = var2;
  18.       this.removed = var3;
  19.       this.added = var4;
  20.    }
  21.  
  22.    public Element[] getChildrenAdded() {
  23.       return this.added;
  24.    }
  25.  
  26.    public Element[] getChildrenRemoved() {
  27.       return this.removed;
  28.    }
  29.  
  30.    public Element getElement() {
  31.       return this.field_0;
  32.    }
  33.  
  34.    public int getIndex() {
  35.       return this.index;
  36.    }
  37.  
  38.    public void redo() throws CannotRedoException {
  39.       super.redo();
  40.       Element[] var1 = this.removed;
  41.       this.removed = this.added;
  42.       this.added = var1;
  43.       ((AbstractDocument.BranchElement)this.field_0).replace(this.index, this.removed.length, this.added);
  44.    }
  45.  
  46.    public void undo() throws CannotUndoException {
  47.       super.undo();
  48.       ((AbstractDocument.BranchElement)this.field_0).replace(this.index, this.added.length, this.removed);
  49.       Element[] var1 = this.removed;
  50.       this.removed = this.added;
  51.       this.added = var1;
  52.    }
  53. }
  54.